<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<?php 
	include_once "captcha.php";
	$check = false;
	if(isset($_REQUEST['key']))
		$check = check_captcha($_REQUEST['key']);	
	$captchagen = generate_captcha(3);
?>
</head>
<title></title>
<body>
	<h1>Captcha test</h1>
	<img  src="./captcha.php?image=<?php echo $captchagen; ?>" />
	<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
		<input name="key" value="" id="key" type="text"  />
		<input name="check" value ="Check"  type="submit" />
	</form>
	<p>
	<?php
		if($check)
			echo "Check OK";
		else
			echo "Check KO";
	?>
	</p>
</body>
</html>